<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>

  <script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-M/vue/2.6.14/vue.js"
    type="application/javascript"></script>
</head>

<body>
  <div id="app">
    <!-- 有标签内容传到子组件，通过父传子 -->
    <no-use-slot :title="title"></no-use-slot>
    <use-slot>
      <h3>测试内容</h3>
    </use-slot>
  </div>
</body>
<script>
  //默认插槽
  //用途
  //特征
  Vue.component('no-use-slot', {
    props: ['title'],
    template: `
      <div v-html="title">不用插槽的子组件 </div>
    `
  })
  Vue.component('use-slot', {
    template: `
      <div>用插槽的子组件 <slot></slot> </div>
    `
  })
  new Vue({
    el: '#app',
    data () {
      return {
        title: '<h4>测试内容没用插槽</h4>'
      }
    },
    created () { },
    mounted () {
    },
    methods: {
    },
  })
</script>

</html>